package com.heima.model.common.enums;

public enum AppHttpCodeEnum {

    // 成功段0
    SUCCESS(200,"操作成功"),
    // 登录段1~50
    NEED_LOGIN(1,"需要登录后操作"),
    LOGIN_PASSWORD_ERROR(2,"密码错误"),
    // TOKEN50~100
    TOKEN_INVALID(50,"无效的TOKEN"),
    TOKEN_EXPIRE(51,"TOKEN已过期"),
    TOKEN_REQUIRE(52,"TOKEN是必须的"),
    // SIGN验签 100~120
    SIGN_INVALID(100,"无效的SIGN"),
    SIG_TIMEOUT(101,"SIGN已过期"),
    // 参数错误 500~1000
    PARAM_REQUIRE(500,"缺少参数"),
    PARAM_INVALID(501,"无效参数"),
    PARAM_IMAGE_FORMAT_ERROR(502,"图片格式有误"),
    SERVER_ERROR(503,"服务器内部错误"),
    // 数据错误 1000~2000
    DATA_EXIST(1000,"数据已经存在"),
    AP_USER_DATA_NOT_EXIST(1001,"ApUser数据不存在"),
    DATA_NOT_EXIST(1002,"数据不存在"),
    // 数据错误 3000~3500
    NO_OPERATOR_AUTH(3000,"无权限操作"),
    NEED_ADMIND(3001,"需要管理员权限"),
    //延迟任务错误
    FAIL_TO_INSERT_TASK(601,"插入任务表失败"),
    FAIL_TO_INSERT_TASK_LOG(602,"插入任务日志表失败"),
    FAIL_TO_DELE_TASK(603,"删除任务表失败"),
    FAIL_TO_UPDATE_TASK_LOG_TO_DELE(604,"更新任务日志状态为已删除失败"),
    //Behavior错误
    NULL_LIKE_DATA(770,"没有点赞过，取消点赞失败"),
    HAS_LIKE(771,"已点赞了"),
    //User错误
    FAIL_TO_UPDATE_USERREALNAME(1501,"审核失败"),
    FAIL_TO_SAVE_FOLLOW(1502,"关注失败"),
    FAIL_TO_CANCEL_FOLLOW(1503,"取消关注失败"),
    //article错误
    HAS_COLLECTION(2501,"已经收藏过了"),
    FAIL_TO_SAVE_COLLECTION(2502,"收藏失败"),
    FAIL_TO_CANCEL_COLLECTION(2503,"取消收藏失败"),
    //自媒体文章错误
    FAIL_TO_SAVE_SENSITIVE(502,"插入敏感词失败"),
    FAIL_TO_DELERE_SENSITIVE(503,"删除敏感词失败"),
    FAIL_TO_UPDATE_SENSITIVE(504,"更新敏感词失败"),
    FAIL_TO_SAVE_CHANNEL(505,"保存频道失败"),
    CHANNEL_HAS_BEEN_USE(506,"频道已被使用"),
    FAIL_TO_DELETE_CHANNEL(507,"频道删除失败"),
    FAIL_TO_UPDATE_CHANNEL(508,"编辑频道失败"),
    CHANNEL_NAME_NULL(509,"频道名称不能为空"),
    MATERIASL_REFERENCE_FAIL(501,"素材引用失效");
    int code;
    String errorMessage;

    AppHttpCodeEnum(int code, String errorMessage){
        this.code = code;
        this.errorMessage = errorMessage;
    }

    public int getCode() {
        return code;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}
